<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - cover.info - /home/andres/Programacion/aso_coverage/aso/src/ASO/framework/combinatory_policy_comp_imp.cpp</title>
  <link rel="stylesheet" type="text/css" href="../../../../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td width="5%"></td>
          <td width="10%" class="headerItem">Current view:</td>
          <td width="35%" class="headerValue"><a href="../../../../../../../../index.html">directory</a> - <a href="index.html">home/andres/Programacion/aso_coverage/aso/src/ASO/framework</a> - combinatory_policy_comp_imp.cpp (source / <a href="combinatory_policy_comp_imp.cpp.func.html">functions</a>)</td>
          <td width="10%"></td>
          <td width="10%" class="headerCovTableHead">Found</td>
          <td width="10%" class="headerCovTableHead">Hit</td>
          <td width="15%" class="headerCovTableHead">Coverage</td>
          <td width="5%"></td>
        </tr>
        <tr>
          <td></td>
          <td class="headerItem">Test:</td>
          <td class="headerValue">cover.info</td>
          <td class="headerItem">Lines:</td>
          <td class="headerCovTableEntry">58</td>
          <td class="headerCovTableEntry">43</td>
          <td class="headerCovTableEntryHi">74.1 %</td>
        </tr>
        <tr>
          <td></td>
          <td class="headerItem">Date:</td>
          <td class="headerValue">2010-08-03</td>
          <td class="headerItem">Functions:</td>
          <td class="headerCovTableEntry">9</td>
          <td class="headerCovTableEntry">7</td>
          <td class="headerCovTableEntryMed">77.8 %</td>
        </tr>
                <tr><td><img src="../../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<a name="1"><span class="lineNum">       1 </span>                : #include &quot;combinatory_policy_comp_imp.h&quot;</a>
<a name="2"><span class="lineNum">       2 </span>                : </a>
<span class="lineNum">       3 </span>                : //!---------Sequential----------
<span class="lineNum">       4 </span><span class="lineCov">              1 : bool SeqCombinatorialGroup::combine(const Avs&amp; elements, CombinationObserver* observer, CombinationStatus&amp; status)</span>
<span class="lineNum">       5 </span>                : {
<span class="lineNum">       6 </span><span class="lineCov">              1 :     CombGroupIterator it(combAlgs);</span>
<span class="lineNum">       7 </span><span class="lineCov">              1 :     CombArgIterator argit(combArgs);</span>
<span class="lineNum">       8 </span><span class="lineCov">              1 :     CombinationStatus auxStatus;</span>
<span class="lineNum">       9 </span><span class="lineCov">              1 :     status.name = get_name();</span>
<span class="lineNum">      10 </span><span class="lineCov">              1 :     bool continueComb(true);</span>
<span class="lineNum">      11 </span>                : 
<span class="lineNum">      12 </span><span class="lineCov">              3 :     while (!it.end() &amp;&amp; continueComb)</span>
<span class="lineNum">      13 </span>                :     {
<span class="lineNum">      14 </span><span class="lineCov">              2 :         Avs intersecAv;             //! elementos disponibles intersección los que debo usar</span>
<span class="lineNum">      15 </span><span class="lineCov">              2 :         set_intersection(elements.begin(), elements.end(), argit-&gt;begin(), argit-&gt;end(), inserter(intersecAv, intersecAv.begin()));</span>
<span class="lineNum">      16 </span>                : 
<span class="lineNum">      17 </span><span class="lineCov">              2 :         continueComb = (*it)-&gt;combine(intersecAv, observer, auxStatus);</span>
<span class="lineNum">      18 </span><span class="lineCov">              2 :         if (auxStatus.status == Success)</span>
<span class="lineNum">      19 </span>                :         {
<span class="lineNum">      20 </span><span class="lineCov">              2 :             status.status = Success;</span>
<span class="lineNum">      21 </span>                :         }
<span class="lineNum">      22 </span><span class="lineCov">              2 :         ++it;</span>
<span class="lineNum">      23 </span><span class="lineCov">              2 :         ++argit;</span>
<span class="lineNum">      24 </span>                :     }
<span class="lineNum">      25 </span><span class="lineCov">              1 :     return continueComb;</span>
<span class="lineNum">      26 </span>                : }
<span class="lineNum">      27 </span>                : 
<a name="28"><span class="lineNum">      28 </span>                : //!----------Parallel------------</a>
<span class="lineNum">      29 </span>                : //! setea el siguiente observador, al cual tengo que emviarle mi combinacion
<span class="lineNum">      30 </span><span class="lineCov">              2 : void ParallelCombinatory::AuxObserverImp::set_next_obs(AuxObserver* obs)</span>
<span class="lineNum">      31 </span>                : {
<span class="lineNum">      32 </span><span class="lineCov">              2 :     nextObs = obs;</span>
<span class="lineNum">      33 </span><span class="lineCov">              2 : }</span>
<a name="34"><span class="lineNum">      34 </span>                : </a>
<span class="lineNum">      35 </span>                : //! Establece el nexo entre los oservadores
<span class="lineNum">      36 </span><span class="lineCov">              1 : bool ParallelCombinatory::AuxObserverImp::combine_obs(const Avs* combination, const Avs* itemsAvailable)</span>
<span class="lineNum">      37 </span>                : {
<span class="lineNum">      38 </span><span class="lineCov">              1 :     lastComb = *combination;</span>
<span class="lineNum">      39 </span><span class="lineCov">              1 :     itAvailable = itemsAvailable;</span>
<span class="lineNum">      40 </span><span class="lineCov">              1 :     Avs intersecAv;                         //! elementos disponibles intersección los que debo usar</span>
<span class="lineNum">      41 </span><span class="lineCov">              1 :     set_intersection(reference_elements.begin(), reference_elements.end(), itemsAvailable-&gt;begin(), itemsAvailable-&gt;end(), inserter(intersecAv, intersecAv.begin()));</span>
<span class="lineNum">      42 </span>                : 
<span class="lineNum">      43 </span><span class="lineCov">              1 :     CombinationStatus auxStatus;</span>
<span class="lineNum">      44 </span><span class="lineCov">              1 :     bool continueComb = comb-&gt;combine(intersecAv, this, auxStatus);     //! disparo el combinador</span>
<span class="lineNum">      45 </span>                : 
<span class="lineNum">      46 </span><span class="lineCov">              1 :     if (auxStatus.status == Error)  //! no genero combinacion</span>
<span class="lineNum">      47 </span>                :     {
<span class="lineNum">      48 </span><span class="lineNoCov">              0 :         if (!isMandatory)         //! no es mandatorio</span>
<span class="lineNum">      49 </span>                :         {
<span class="lineNum">      50 </span><span class="lineNoCov">              0 :             continueComb = nextObs-&gt;combine_obs(combination, itemsAvailable);  //! comunico la combinacion al siguiente obs</span>
<span class="lineNum">      51 </span>                :         }
<span class="lineNum">      52 </span>                :         else
<span class="lineNum">      53 </span>                :         {
<span class="lineNum">      54 </span><span class="lineNoCov">              0 :             subCombStatus = auxStatus;</span>
<span class="lineNum">      55 </span><span class="lineNoCov">              0 :             return false;</span>
<span class="lineNum">      56 </span>                :         }
<span class="lineNum">      57 </span>                :     }
<span class="lineNum">      58 </span><span class="lineCov">              1 :     return continueComb;</span>
<span class="lineNum">      59 </span>                : }
<a name="60"><span class="lineNum">      60 </span>                : </a>
<span class="lineNum">      61 </span>                : //! Observador intermedio
<span class="lineNum">      62 </span><span class="lineNoCov">              0 : bool ParallelCombinatory::AuxObserverImp::update(const Avs* t)</span>
<span class="lineNum">      63 </span>                : {
<span class="lineNum">      64 </span><span class="lineNoCov">              0 :     Avs unionAv;</span>
<span class="lineNum">      65 </span><span class="lineNoCov">              0 :     Avs temp = lastComb;</span>
<span class="lineNum">      66 </span><span class="lineNoCov">              0 :     set_union(temp.begin(), temp.end(), t-&gt;begin(), t-&gt;end(), inserter(unionAv, unionAv.begin()));</span>
<span class="lineNum">      67 </span><span class="lineNoCov">              0 :     return nextObs-&gt;combine_obs(&amp;unionAv, itAvailable);    //! comunico la combinacion al siguiente obs</span>
<a name="68"><span class="lineNum">      68 </span>                : }</a>
<span class="lineNum">      69 </span>                : 
<span class="lineNum">      70 </span><span class="lineNoCov">              0 : bool ParallelCombinatory::FinalObserver::combine_obs(const Avs* combination, const Avs* itemsAvailable)</span>
<span class="lineNum">      71 </span>                : {
<span class="lineNum">      72 </span><span class="lineNoCov">              0 :     bool continueObs(true);</span>
<span class="lineNum">      73 </span><span class="lineNoCov">              0 :     if (observed_by != NULL)</span>
<span class="lineNum">      74 </span>                :     {
<span class="lineNum">      75 </span><span class="lineNoCov">              0 :         continueObs = observed_by-&gt;update(combination);</span>
<span class="lineNum">      76 </span>                :     }
<span class="lineNum">      77 </span>                :     else
<span class="lineNum">      78 </span>                :     {
<span class="lineNum">      79 </span><span class="lineNoCov">              0 :         throw SystemError(&quot;at Parallel Combinatory: the observer is not set&quot;);</span>
<span class="lineNum">      80 </span>                :     }
<span class="lineNum">      81 </span><span class="lineNoCov">              0 :     return continueObs;</span>
<span class="lineNum">      82 </span>                : }
<a name="83"><span class="lineNum">      83 </span>                : </a>
<span class="lineNum">      84 </span>                : //! Agrega una politica combinatoria
<span class="lineNum">      85 </span><span class="lineCov">              2 : void ParallelCombinatory::add_policy(CombinatoryPolicy* policy, const Avs&amp; reference_elements, bool isMandatory)</span>
<span class="lineNum">      86 </span>                : {
<span class="lineNum">      87 </span><span class="lineCov">              2 :     AuxObserverImp* const aux = new AuxObserverImp(policy, reference_elements, isMandatory, subCombStatus);  //! observador auxiliar</span>
<span class="lineNum">      88 </span><span class="lineCov">              2 :     if (firstObs != NULL)                                        //! si no es el primero</span>
<span class="lineNum">      89 </span><span class="lineCov">              1 :         lastObs-&gt;set_next_obs(aux);</span>
<span class="lineNum">      90 </span>                :     else
<span class="lineNum">      91 </span><span class="lineCov">              1 :         firstObs = aux;</span>
<span class="lineNum">      92 </span><span class="lineCov">              2 :     lastObs = aux;</span>
<span class="lineNum">      93 </span><span class="lineCov">              2 : }</span>
<a name="94"><span class="lineNum">      94 </span>                : </a>
<span class="lineNum">      95 </span>                : //! Combina en paralelo
<span class="lineNum">      96 </span><span class="lineCov">              1 : bool ParallelCombinatory::combine(const Avs&amp; elements, CombinationObserver* observer, CombinationStatus&amp; status)</span>
<span class="lineNum">      97 </span>                : {
<span class="lineNum">      98 </span><span class="lineCov">              1 :     status = subCombStatus;</span>
<span class="lineNum">      99 </span>                :     //FinalObserver finalObs;
<span class="lineNum">     100 </span><span class="lineCov">              1 :     finalObs-&gt;set_final_obs(observer);</span>
<span class="lineNum">     101 </span><span class="lineCov">              1 :     lastObs-&gt;set_next_obs(finalObs);</span>
<span class="lineNum">     102 </span><span class="lineCov">              1 :     Avs emptyComb;</span>
<span class="lineNum">     103 </span>                : 
<span class="lineNum">     104 </span><span class="lineCov">              1 :     bool continueComb = firstObs-&gt;combine_obs(&amp;emptyComb, &amp;elements);           //! combino</span>
<a name="105"><span class="lineNum">     105 </span><span class="lineCov">              1 :     status = subCombStatus;</span></a>
<span class="lineNum">     106 </span><span class="lineCov">              1 :     return continueComb;</span>
<span class="lineNum">     107 </span><span class="lineCov">              3 : }</span>
<span class="lineNum">     108 </span>                : 
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.7</a></td></tr>
  </table>
  <br>

</body>
</html>
